cmake_minimum_required (VERSION 3.10)

project (LearnAlgorithm)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g ")

include_directories ( include )

#libary main file
file(GLOB_RECURSE LIB_FILES
        lib/*.cpp
        include/lib/*.hpp
        )

file(GLOB_RECURSE LEETCODE_FILES
        leetcode/*.cpp
        include/leetcode/*.hpp
        )

file(GLOB_RECURSE LEETCODE_TEST_FILES
        test/leetcode/*.cpp
        )

find_package(GTest REQUIRED)
add_executable (tests test/tests.cpp ${LEETCODE_TEST_FILES} ${LIB_FILES} ${LEETCODE_FILES} )
target_link_libraries(tests ${GTEST_LIBRARIES})


# 启用测试
enable_testing()

add_test (tests_run tests)
# 测试 1 + 3 , 是否输出打印'is 4'
#set_tests_properties (tests_run PROPERTIES PASS_REGULAR_EXPRESSION "is 4")  #